package com.eii.rocketmq.controller;

import com.eii.rocketmq.service.GeneralMQMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rocketMq")
@Api(tags = "rocketMq")
public class MQMessageController {

    @Autowired
    private GeneralMQMessageService generalMQMessageService;

    /**
     * rocketMq同步消息发送测试
     */
    @ApiOperation("rocketMq同步消息发送测试")
    @GetMapping("/syncGeneralMQMessageSend")
    public void syncGeneralMQMessageSend() {
        generalMQMessageService.syncGeneralMQMessageSend();
    }

    /**
     * rocketMq同步批量消息批量发送测试
     */
    @ApiOperation("rocketMq同步消息批量发送测试")
    @GetMapping("/syncGeneralMQMessageSendBatch")
    public void syncGeneralMQMessageSendBatch() {
        generalMQMessageService.syncGeneralMQMessageSendBatch();
    }

    /**
     * rocketMq异步消息发送测试
     */
    @ApiOperation("rocketMq异步消息发送测试")
    @GetMapping("/asyncSendMQMessageSend")
    public void asyncSendMQMessageSend() {
        generalMQMessageService.asyncSendMQMessageSend();
    }

    /**
     * rocketMq单向发送不关心结果的发送测试【日志收集】
     */
    @ApiOperation("rocketMq单向发送不关心结果的发送测试【日志收集】")
    @GetMapping("/oneWaySendMQMessageSend")
    public void oneWaySendMQMessageSend() {
        generalMQMessageService.oneWaySendMQMessageSend();
    }

    /**
     * 延迟消息发送测试
     */
    @ApiOperation("延迟消息发送测试")
    @GetMapping("/delayedSendMQMessageSend")
    public void delayedSendMQMessageSend() {
        generalMQMessageService.delayedSendMQMessageSend();
    }

    /**
     * 顺序消息发送
     */
    @ApiOperation("顺序消息发送")
    @GetMapping("/orderlyMQMessageSend")
    public void orderlyMQMessageSend() {
        generalMQMessageService.orderlyMQMessageSend();
    }

    /**
     * 分布式事务消息发送
     */
    @ApiOperation("分布式事务消息发送")
    @GetMapping("/transactionMQSend")
    public void transactionMQSend() {
        generalMQMessageService.transactionMQSend();
    }

    /**
     * 消息过滤消息发送
     */
    @ApiOperation("消息过滤消息发送")
    @GetMapping("/selectorMQSend")
    public void selectorMQSend() {
        generalMQMessageService.selectorMQSend();
    }
}
